<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>登  录</title>
    <%@ include file="/ui/jsp/util.jspf" %>
	<script type="text/javascript">
        $(function(){
            $("body").append("<div id='main_bg' style='position:absolute;top:0; z-index:-10;'/>");
            $("#main_bg").append("");
            $("#main_bg").append("<img src='ui/images/login_bg.png' id='bigpic'>");
            cover1();
            $(window).resize(function(){ //浏览器窗口变化
                cover1();
            });
        });
        function cover1(){
            var win_width_l = $(window).width();
            var win_height_l = $(window).height();
            $("#bigpic").attr({width:win_width_l,height:win_height_l});
        }
        
        function login(){
        	$("#userErrorMsg").html("");
            $("#passwordErrorMsg").html("");
            $("#codeErrorMsg").html("");
            $("#errorMsg").html("");
            if ("" == $.trim($("#userName").val())) {
                $("#userErrorMsg").html("用户名不能为空");
                return false;
            }
            if ("" == $.trim($("#password").val())) {
                $("#passwordErrorMsg").html("密码不能为空");
                return false;
            }
        	$("#loginForm").submit();
        }
    </script>
  </head>
  
<body>
<div class="container">
	<div style="padding: 30px;">
    	<img src="ui/images/sto_logo2.png"/>
	</div>
    <div class="row">
        <div class="col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
            <div class="row">
            	<div class="row">
                <div class="col-sm-12">
                    <div class="login_box">
                        <form id="loginForm" action="${ctx}/Caitlyn/Login/index" method="post">
                            <h4 class="form-group gray3">登  录</h4>
                            <input type="text" id="userName" name="userName" placeholder="请输入用户名" class="form-control form_margin">
                            <span  id="userErrorMsg" style="color:red; height: 0px;line-height: 20px;"></span>
                            <input type="password" id="password" name="password" placeholder="请输入密码" class="form-control form_margin">
                            <span id="passwordErrorMsg" style="color:red; height: 0px;line-height: 20px;"></span>
                            <div class="row form_margin">
                                <div class="col-sm-5">
                                    <input type="text" placeholder="验证码" class="form-control" style="display: inline-block">
                                </div>
                                <div class="col-sm-7">
                                    <label><img src="ui/images/yanzengma.png" /><a href="#">换一张</a> </label>
                                </div>
                            </div>
                            <button type="button" onclick="login()" class="btn btn-warning form_margin" style="width: 100%">登录</button>
                        </form>
                    </div>
                </div>
            </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
